import {httpGet, httpPost, httpDelete, httpPut} from '../services/http'
import {BaseDTO} from './base'
declare type Int64 = number

export interface LoginDTO {
  posId: string
  mac: string
  token: string
}

export interface LoginVO {
  //账号
  account: string
  //密码 md5 加密
  password: string
  //pos机 mac地址
  mac?: string
}

export interface CustomerInfoDTO {
  id?: string
  name?: string
  tell?: string
  idNumber?: string
}

export default {
  user: {
    login(data: LoginVO): Promise<LoginDTO> {
      const path = `/api/public/account/login`
      return httpPost(path, data).then(res => {
        return res.data.data
      })
    },
    getCustomerInfoBytell(params: {tell: string}): Promise<CustomerInfoDTO> {
      const path = `/api/pos-app/getCustomerInfoBytell`
      return httpGet(path, {params}).then(res => res.data.data)
    },
  },
}
